home *** CD-ROM | disk | FTP | other *** search
/ Ultimedia 1 / Ultimedia 1.iso / tools / sonstiges / easysound / example2.c < prev    next >
C/C++ Source or Header  |  1994-08-05  |  1KB  |  54 lines

  1. /*
  2.  * Play an external sound, i.e the sample is loaded first and then played
  3.  *
  4.  * Compile: dcc -f -v -// -3.0 -leasysound
  5.  */
  6.  
  7. #include <exec/types.h>
  8. #include "easysound.h"
  9.  
  10. main() {
  11.  
  12.     struct SoundInfo *whiff;
  13.  
  14.     /*
  15.      * Load an 8SVX Sample
  16.      */
  17.     whiff = (struct SoundInfo *)LoadIff("whiff.8svx");
  18.  
  19.     /*
  20.      * If the sample isn't loaded exit
  21.      */
  22.     if (!whiff) {
  23.         puts("Sorry, I can't play this file");
  24.     }
  25.  
  26.     /*
  27.      * Play the sample
  28.      */
  29.     PlayIff(whiff,            // The sound data
  30.             64,               // Max Volume
  31.             L0,               // Play Sound on the left channel
  32.             -35,              // Priority
  33.             0,                // Play at original rate
  34.             1,                // Play the sound 1 time
  35.             0,                // Play this sample from the beginning
  36.             0,                // Play the whole sample
  37.             1,                // Wait 'til the sample if played
  38.             );
  39.  
  40.     /*
  41.      * Stop the sample
  42.      */
  43.     StopIff(L0);    // Stop Sound on L0
  44.  
  45.     /*
  46.      * Free the memory
  47.      */
  48.     RemoveIff(whiff);
  49. }
  50.  
  51.  
  52.  
  53.  
  54.